package aspect;

import org.aspectj.lang.ProceedingJoinPoint;

public class LogAspect {
	public void logBefore(){
		System.out.println("log before");
	}
	public void logAfter(){
		System.out.println("log after");
	}
	public Object logAround(ProceedingJoinPoint point){
		
		//获得接入点
		String s =(String) point.getArgs()[0];
		Object o = null;
		System.out.println("log around before");
		try {
			//call target
			o = point.proceed(new Object[]{s.toUpperCase()});
		} catch (Throwable e) {
			e.printStackTrace();
		}
		System.out.println("log around after");
		return o;
	}
}
